//
//  AFN.m
//  纪宇婚礼纪
//
//  Created by dllo on 15/12/21.
//  Copyright © 2015年 LT. All rights reserved.
//

#import "AFN.h"
#import "AFNetworking.h"

@implementation AFN
+(void)getWithNsstring:(NSString *)string block:(AFNBLOCK)block error:(AFNERRORBLOCK)ErrorBlock{
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html",nil];
    [manager GET:string parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        //回调
        block(responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        NSLog(@"失败==== %@",error);
        //失败时回调
        ErrorBlock(error);
    }];
//    -fobjc-arc
}
@end
